<% content_for :header do -%>
  <%= stylesheet_link_tag    "jquery.autocomplete.css", "token-input" %>
  <%= javascript_include_tag "jquery.ui.autocomplete", "jquery.tokeninput" %>
  <script type="text/javascript">
    $(document).ready(function() {
      $('#idea_requirments').tokenInput("<%= speciality_autocomplete_path %>.json", {
        crossDomain: false,
        prePopulate: $("#idea_requirments").data("pre"),
      });
    });
  </script>
  
<% end -%>

<%= form_for(@idea,:html => {:id => "add-form"}) do |f| %>
  <% if @idea.errors.any? %>
    <div class="message error_message">
      <h2><%= pluralize(@idea.errors.count, "error") %> prohibited this idea from being saved:</h2>

      <ul>
      <% @idea.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  
  <p>
    <%= label_tag :name %><br/>
    <%= f.text_field :name %>
  </p>
  <p>
    <%= label_tag :abstract %>
    <%= f.text_area :abstract %>
  </p>
  <p>
    <%= f.label :requirments %>
    <%= f.text_field :requirments, "data-pre" => @idea.requirments %>
  </p>
  
  
  
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
